﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;

namespace AspDataBinding
{
    public partial class TreeViewXML : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
            XmlDataSource data = new XmlDataSource();
            data.DataFile="parts.xml";
            TreeViewXml.DataSource = data;
            TreeViewXml.DataBind();
           
            
        }
        protected void TreeNode_SelectionChanged(object sender, EventArgs e)
        {
            XmlDocument asd = new XmlDocument();
            asd.Load(@"C:\Users\Academy\Documents\visual studio 2010\Projects\AspDataBinding\AspDataBinding\parts.xml");
            XmlNode node = asd.SelectSingleNode(TreeViewXml.SelectedNode.DataPath);
            Response.Write(node.InnerXml);
        }
    }
}